import {
  tools,
} from '../utils/index';
import {
  TCompareFunc,
} from '../utils/tools';

import {
  MinHeap
} from './minHeap';

const {
  defaultCompare,
} = tools;

export class MaxHeap extends MinHeap {
  public constructor(elements?: any[], compareFunc?: TCompareFunc) {
    super(elements, (a, b) => {
      return (compareFunc || defaultCompare)(b, a);
    });
  }
}
